home *** CD-ROM | disk | FTP | other *** search
- /* wyse1.c */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <alloc.h>
- #include <string.h>
- #include <time.h>
- #include <dir.h>
-
- /* AutoLibrary by Avid Software */
- #include "al.h"
-
- /* WYSE tests include file. */
- #define GLOBAL 1
- #include "wyse.h"
-
- #ifndef TRUE
- #define TRUE 1
- #endif
-
- #ifndef FALSE
- #define FALSE 0
- #endif
-
- /* Globals */
- int long_version;
-
- /* Options accepted by this program. */
- static char *o_all = "+a"; /* Run all tests. */
- static char *o_abort_on_error = ".A"; /* Abort program if an error occur. */
- static char *o_long_version = "-L"; /* Run the over night tests. */
- static char *o_protected_mode = "+p"; /* Run protected mode test. */
- static char *o_scr_attribs = "-a"; /* Run the screen attributes test. */
- static char *o_scr_loc = "+s"; /* Run the screen location test. */
- static char *o_scr_print = "+P"; /* Run the screen print test. */
-
- /*****/
- void EveryChar(c)
- int c;
- /*****/
- {
- char s[20];
- int add_info;
-
- AvidConvert(c, s, &add_info, "");
- /* turn off printing
- printf("%s", s);
- */
- }
-
- /*****/
- void main(argc, argv)
- /*****/
- int argc;
- char *argv[];
- {
- int com;
- int i;
- char arg_str[100];
- char sc, control;
- char arg[85];
- char temp_buf[100];
- int err, add_info;
-
- randomize();
-
- /* Initial AutoLibrary. */
- AvidInitAutoLibrary(AVID, &add_info, "_B'3'");
-
- /* Print help screen if no options are specified. */
- if (argc == 1) {
- printf("\nUsage: wyse <options>\n\n");
- printf("Where: <options> are...\n");
- printf("%s --- Run all tests.\n", o_all);
- printf("%s --- Abort program if an error occurs. (Default is continue)\n", o_abort_on_error);
- printf("%s --- Run long version of tests..\n", o_long_version);
- printf("%s --- Run protected mode test.\n", o_protected_mode);
- printf("%s --- Run screen attributes test.\n", o_scr_attribs);
- printf("%s --- Run screen location test.\n", o_scr_loc);
- printf("%s --- Run screen print test.\n", o_scr_print);
- exit(0);
- }
-
- /* Combine all options into one string so ak_opts can be used. */
- for (i=1,arg_str[0]='\0'; i < argc; i++) {
- strcat(arg_str, " ");
- strcat(arg_str, argv[i]);
- }
-
- /* Find out if over night tests should be done. */
- if (AvidProcessOptions(AVID, arg_str, o_long_version,
- &control, arg, &i) != '\0')
- long_version = TRUE;
- else
- long_version = FALSE;
-
- /* Open the communcation port. */
- com = AvidOpenPort(AVID, "com1", &add_info, ".b'9600' .1 .8 .n +S -H");
-
- /* Find out if abort should be done when error occurs. */
- if (AvidProcessOptions(AVID, arg_str, o_abort_on_error, &control, arg, &i) != '\0')
- AvidLogOpen(AVID, com, "logfile", &add_info, "+E");
- else
- AvidLogOpen(AVID, com, "logfile", &add_info, "");
-
- /* Display AutoLibrary version. */
- AvidVersion(AVID, &add_info, "");
-
- /* Find out what kind of batch mode testing to do. */
- i=0; /* Required for AvidProcessOptions. */
- while ((sc = AvidProcessOptions(AVID, arg_str, "", &control,
- arg, &i)) != '\0') {
-
- if ((o_all[0] == control) && (o_all[1] == sc)) {
-
- initialize_testing(com);
-
- test_scr_loc(com, 20, 80);
- test_scr_print(com, 20, 80);
- test_scr_attribs(com);
- test_protected_mode(com);
- }
-
- if ((o_scr_loc[0] == control) && (o_scr_loc[1] == sc)) {
- initialize_testing(com);
- test_scr_loc(com, 20, 80);
- }
-
- if ((o_scr_print[0] == control) && (o_scr_print[1] == sc)) {
- initialize_testing(com);
- test_scr_print(com, 20, 80);
- }
-
- if ((o_scr_attribs[0] == control) && (o_scr_attribs[1] == sc)) {
- initialize_testing(com);
- test_scr_attribs(com);
- }
-
- if ((o_protected_mode[0] == control) && (o_protected_mode[1] == sc)) {
- initialize_testing(com);
- test_protected_mode(com);
- }
- }
-
- /* Clear the screen. */
- clear_wyse_screen(com);
-
- /* Finished so close the com port. */
- AvidClosePort(AVID, com, &add_info, "");
-
- /* Exit from AutoLibrary. */
- AvidExitAutoLibrary(AVID, &add_info, "");
- }